let f1 = function() {}
let f2 = () => {}

let f3: {
    (n: number): void;
    (s: string): void
} = () => {
}

class MyClass1 {
    x: number = 100
    constructor() {
    }
}
let x1 = new MyClass1()

// MyClass1 等价于下面的写法

interface MyClass {
    x: number
}

interface MyClassConstructor {
    new(): MyClass // 确保调用new时返回的是 MyClass 类型
    (this: MyClass): void // 保证函数界面的this类型是 MyClass
    prototype: MyClass // 声明原型
}

let MyClass = function() {
    this.x = 100
} as MyClassConstructor

let x2 = new MyClass()
x2 = x1
